package org.jslaughter.event.eventtype;

import org.nvframe.entity.Entity;
import org.nvframe.event.AbstractEvent;
import org.nvframe.event.EventListener;

/**
 * 
 * @author Nik Van Looy
 */
public class DeathEvent extends AbstractEvent {

	private static Class<? extends EventListener> listener = DeathListener.class;
	
	private Entity entity;

	public DeathEvent(Entity owner) {
		// set event-specific properties
		this.entity = owner;
	}
	
	public void dispatchToListener(EventListener listener) {
		((DeathListener) listener).onDeath(this);
	}

	public Entity getEntity() {
		return entity;
	}

	@Override
	protected Class<? extends EventListener> getListener() {
		return listener;
	}
	
}
